

#include "PostprocessorTimeBC.h"
#include "Assembly.h"
#include "MooseVariableFE.h"
#include "SystemBase.h"

#include "libmesh/quadrature.h"
registerMooseObject("TrilobitaApp", PostprocessorTimeBC);

// Used by MOOSEDocs: syntax/Postprocessors/index.md
defineLegacyParams(PostprocessorTimeBC);

InputParameters
PostprocessorTimeBC::validParams()
{
    InputParameters params = NodalBC::validParams();
    params.addRequiredParam<PostprocessorName>(
        "postprocessor", "The postprocessor to set the time derivative value to on the boundary.");
    return params;
}

PostprocessorTimeBC::PostprocessorTimeBC(const InputParameters& parameters)
    : NodalBC(parameters), _u_dot(_var.uDot()), _postprocessor_value(getPostprocessorValue("postprocessor"))
{
}

Real
PostprocessorTimeBC::computeQpResidual()
{
    return _u_dot[_qp] - _postprocessor_value;
}
